﻿#region Using

using System.Runtime.Serialization;

using CommunicationLibrary.Converter;
using CommunicationLibrary.TransportData.Enums;

using GameLogic.External;

#endregion

namespace CommunicationLibrary.TransportData
{
    [DataContract(Name = "A", IsReference = true)]
    public class Building
    {
        public Building(IBuilding building)
        {
            this.BuildingType = BuildingTypeConverter.Convert(building.BuildingType);
            this.CurrentProgress = building.CurrentProgress;
            this.WaitingFarmers = building.WaitingFarmers;
            this.Identifier = building.Identifier;
        }

        [DataMember(Name = "A")]
        public int Identifier { get; private set; }

        [DataMember(Name = "B")]
        public BuildingTypeEnum BuildingType { get; private set; }

        [DataMember(Name = "C")]
        public int WaitingFarmers { get; private set; }

        [DataMember(Name = "D")]
        public float CurrentProgress { get; private set; }
    }
}